<table summary="" id="pagehead" cellpadding="0" cellspacing="0" border="0" width="100%">
	<tr>
		<td><h1>系统下单</h1></td>
		<td class="actions">
			<table summary="" cellpadding="0" cellspacing="0" border="0" align="right">
				<tr>
                	<td ><a href="#">选择客户</a></td>
					<td ><a href="#">选择约货人</a></td>
					<td class='active'><a href="#">选择商品</a></td>
                    <td><a href="#">查看购物车</a></td>
                    <td><a href="#">确认下单</a></td>
				</tr>
			</table>
		</td>
	</tr>
</table>
<script>
function OpenWindow(pid)
{
	var lid = $('#lid').val();
	CreateWindow('?app=order&mod=product&pid='+pid+'&lid='+lid,'选择商品');
}
function CloseWindow()
{
	Boxy.loadBoxy.unload();
}

function reloadPage()
{
	location.reload();
}
$(function(){
    $('#submit_cart').click(function(){
        $.post(location.href,{pid:$('#cart_pid').val(),num:$('#cart_pnum').val(),price:$('#price').val()},function(data){
            if (data.state <= 0)
            {
                alert(data.message);
                return false;
            }
            dialogMessage(data.message,'green');
        },'json');
    });

    $('#searchtype').val(INPUT_GET.searchtype);
    $('#keyword').val(INPUT_GET.keyword);
});
</script>
<div class="search">
    <form id='search'>
        <span>
            <select name="searchtype" id="searchtype" class="select1">
                <option>请选择查询类型</option>
                <option value="code">货号</option>
                <option value="product_name">商品名称（慢）</option>
                <option value="systemtype">系统类型</option>
            </select>
        </span>

        <span>
            <input type="text" name="keyword" id="keyword" value="" />
        </span>

        <span><input type="submit" value="搜索" /><?php echo showhide($_GET); ?></span>
    </form>
</div>
<div class="line_1"></div>
<table width="100%" cellpadding="0" cellspacing="0" border="0" class="table1">
       <tr>
            <th class="th0" rel="product_id">编号</th>
            <th class="th1">商品民称</th>
            <th class="th0" rel="code">货号</th>
            <th class="th1" rel="num">库存</th>
            <th class="th1" rel="sold_num">已售出</th>
            <th class="th1" rel="systemtype">系统类型</th>
            <th class="th1" rel="created_time">创建时间</th>
            <th class="th0">操作</a>
       </tr>
       <?php foreach($this->products as $product): ?> 
       <tr id="col_<?=$product['product_id']; ?>" <?php if($product['isCache']=='1'): ?> style='background:#e3eaff;' <?php endif; ?>>
            <td><?php echo $product['product_id']; ?></td>
            <td><?php echo $product['name']; ?></td>
            <td><?php echo $product['code']; ?></td>
            <td><?php echo $product['num']; ?></td>
            <td><?php echo $product['sold_num']; ?></td>
            <td><?php echo $product['systemtype']; ?></td>
            <td><?php echo date('Y-m-d H:i:s',$product['created_time']); ?></td>
            <td><a href="javascript:;" onclick="return OpenWindow('<?php echo $product['product_id']; ?>');"><img src="./res/image/icon_cart.gif" title='添加到后台购物车' class='addcart' /></a></td>
        </tr>
       <?php endforeach; ?>
</table>
<div class="page_num">
     <div class="fl">
        <span style="color:red">第三步：请添加商品到<?php echo $this->currc['username']; ?>的购物车</span>
     </div>
     <div class="fr">
        <p class="cpager">
            <?php echo $this->pager; ?>
        </p>
     </div>
</div>
<div style=" width:100%; text-align:right; margin-top:10px;">
	<a href="<?=$this->headlinks;?>" id="GotoShoppingCart"  class="btn-pay"></a>
</div>